#ifndef MESSAGEBUBBLE_H
#define MESSAGEBUBBLE_H

#include <QWidget>
#include "global.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class MessageBubble;
}
QT_END_NAMESPACE

class MessageBubble : public QWidget
{
    Q_OBJECT

public:
    MessageBubble(QWidget *parent = nullptr,
                  QString icon = "",
                  QString name = "",
                  QString text = "",
                  MessageType messageType = MessageType::Image,
                  bool self = true,
                  bool showName = false);
    ~MessageBubble();
    void setText(QString);

private:
    Ui::MessageBubble *ui;
    QString _icon;
    QString _name;
    bool _showName;
    bool _self;
    QString _text;
    MessageType _messageType;
    QString adjustContentRectSize();
protected:
    virtual void paintEvent(QPaintEvent *event) override;

    // QWidget interface
protected:
    virtual void resizeEvent(QResizeEvent *event) override;

    // QWidget interface
public:
    virtual QSize sizeHint() const override;
};
#endif // MESSAGEBUBBLE_H
